<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选项卡</title>

    <style>

        .tab{
            width: 300px;
        }
        .tab_title{
            width: 200px;
        }
        .tab_title div{
            height: 25px;
            line-height: 25px;
            width: 22%;
            float: left;
            background: #cee3f2;
            color: #595959;
            text-align: center;
            font-size: 14px;
            cursor: pointer;
            border-radius: 30px;
            margin-left: 3%;
        }
        .tab_title div.active{
            background: #3499db;
            color: #FFF;

        }
        .tab_content{
            clear: left;
        }
        .tab_content div{
            display: none;
            height: 400px;
            background: #DDD;
        }

        .tab_content div.active{
            display: block;
        }
    </style>
</head>
<body>

<div class="tab">
    <div class="tab_title">
        <div class="active">111</div>
        <div>222</div>
        <div>333</div>
        <div>444</div>
    </div>
    <div class="tab_content">
        <div class="active">1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
    </div>
</div>




<!--<script src="jquery-3.2.1.min.js"></script>-->
<!--<script src="http://libs.baidu.com/jquery/1.8.3/jquery.min.js"></script>-->
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
    $('.tab_title>div').click(function(){
        $('.tab_title div').removeClass('active');
        $(this).addClass('active');
        $('.tab_content div').removeClass('active').eq($(this).index()).addClass('active');

    })
</script>
</body>
</html>